home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / basic / hugearr.zip / HUGEARR.C < prev    next >
C/C++ Source or Header  |  1992-04-02  |  1KB  |  47 lines

  1.  
  2. /* HUGEARR.DLL
  3.    Huge array support for Microsoft Visual Basic
  4.  
  5.    Original program by Mike Warning.
  6.    Modifications by Jonathan Zuck, Stephen Schmidt, and
  7.    End User Computing, Ltd.
  8.  
  9.    This module contains only the DLL entry and exit functions.
  10. */
  11.  
  12. /* VBG: '########## HUGEARR -- Huge Array Functions -- Global */
  13. /* VBM: '########## HUGEARR -- Huge Array Functions -- Module */
  14.  
  15. #define NOCOMM
  16. #include <windows.h>
  17.  
  18. #include "hugearr.h"
  19.  
  20. HANDLE hLocalMem;  /* handle to local memory */
  21. int    NumArrays;  /* total number of arrays */
  22.  
  23. int FAR PASCAL
  24. LibMain(HANDLE hInstance, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine)
  25.     {
  26.     if (cbHeapSize > 0)
  27.         UnlockData(0);
  28.  
  29.     /* Allocate memory for array descrips. */
  30.     hLocalMem = LocalAlloc(LMEM_MOVEABLE | LMEM_ZEROINIT, LocalCompact((WORD) 32768));
  31.     if (hLocalMem == NULL)
  32.         /* Something happened, bomb out */
  33.         return 0;
  34.  
  35.     /* calc total number of arrays */
  36.     NumArrays = (int) (LocalSize(hLocalMem) / sizeof(HUGEDESC));
  37.  
  38.     return 1;
  39.     }
  40.  
  41. int FAR PASCAL
  42. WEP(int nParameter)
  43.     {
  44.     LocalFree(hLocalMem);
  45.     return 1;
  46.     }
  47.